from django.contrib import admin
from django.urls import path, include
from . import views
from django.conf import settings
from django.conf.urls.static import static
# from rest_framework.documentation import include_docs_urls
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="FYue API Docs",
        default_version='v1',
        description="FYue API Docs",
        terms_of_service="https://note.fyue.xyz",
        contact=openapi.Contact(email="bfan97@163.com"),
        license=openapi.License(name="FYue License"),
    ),
    public=True,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/login/', views.login, name='login'),
    path('api/get_username/', views.GetUserName, name='get_username'),
    path('api/closet/', include('closet.urls')),
    # path('docs/', include_docs_urls(title='FYue API Docs')),
    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
